* Identify municipalities with homeopathic GPs
* Data from https://www.homoeopathie.at/suche/arztsuche/ Österreichische Gesellschaft für Homöopathische Medizin (ÖGHM)

import delimited "$raw/homeopathy.csv", encoding(UTF-8) varnames(1) clear 

gen municipality_name = substr(ort,6,.)
gen plz = substr(ort,1,4)
destring plz, replace

replace municipality_name = "Wien  1. Innere Stadt" if plz==1010
replace municipality_name = "Wien  2. Leopoldstadt" if plz==1020
replace municipality_name = "Wien  3. Landstraße" if plz==1030
replace municipality_name = "Wien  4. Wieden" if plz==1040
replace municipality_name = "Wien  5. Margareten" if plz==1050
replace municipality_name = "Wien  6. Mariahilf" if plz==1060
replace municipality_name = "Wien  7. Neubau" if plz==1070
replace municipality_name = "Wien  8. Josefstadt" if plz==1080
replace municipality_name = "Wien  9. Alsergrund" if plz==1090
replace municipality_name = "Wien 10. Favoriten" if plz==1100
replace municipality_name = "Wien 11. Simmering" if plz==1110
replace municipality_name = "Wien 12. Meidling" if plz==1120
replace municipality_name = "Wien 13. Hietzing" if plz==1130
replace municipality_name = "Wien 14. Penzing" if plz==1140
replace municipality_name = "Wien 15. Rudolfsheim-Fünfhaus" if plz==1150
replace municipality_name = "Wien 16. Ottakring" if plz==1160
replace municipality_name = "Wien 17. Hernals" if plz==1170
replace municipality_name = "Wien 18. Währing" if plz==1180
replace municipality_name = "Wien 19. Döbling" if plz==1190
replace municipality_name = "Wien 20. Brigittenau" if plz==1200
replace municipality_name = "Wien 21. Floridsdorf" if plz==1210
replace municipality_name = "Wien 22. Donaustadt" if plz==1220
replace municipality_name = "Wien 23. Liesing" if plz==1230


replace municipality_name = "Neusiedl am See" if municipality_name=="Neusiedl/See"
replace municipality_name = "Neustadtl an der Donau" if municipality_name=="Neustadtl"
replace municipality_name = "Nötsch im Gailtal" if municipality_name=="Nötsch"
replace municipality_name = "Ober-Grafendorf" if municipality_name=="Obergrafendorf"
replace municipality_name = "Oberdorf im Burgenland" if municipality_name=="Oberdorf/Bgld."
replace municipality_name = "St. Egyden am Steinfeld" if municipality_name=="St.Egyden"
replace municipality_name = "St. Pölten" if municipality_name=="St.Pölten"
replace municipality_name = "Sankt Veit im Pongau" if municipality_name=="St.Veit"

replace municipality_name = "Persenbeug-Gottsdorf" if municipality_name == "Persenbeug"
replace municipality_name = "Puchberg am Schneeberg" if municipality_name == "Puchberg/Schneeberg"
replace municipality_name = "Pöls-Oberkurzheim" if municipality_name == "Pöls"
replace municipality_name = "Pörtschach am Wörther See" if municipality_name == "Pörtschach"
replace municipality_name = "Schwaz" if municipality_name == "Schwaz/Tirol"
replace municipality_name = "Schützen am Gebirge" if municipality_name == "Schützen"
replace municipality_name = "Seekirchen am Wallersee" if municipality_name == "Seekirchen"
replace municipality_name = "Spittal an der Drau" if municipality_name == "Spittal/Drau"
replace municipality_name = "St. Andrä-Wördern" if municipality_name == "St. Andrä/Wördern"
replace municipality_name = "St. Nikola an der Donau" if municipality_name == "St. Nikola/Donau"
replace municipality_name = "St. Veit an der Glan" if municipality_name == "St. Veit/Glan"
replace municipality_name = "Steinakirchen am Forst" if municipality_name == "Steinakirchen/Forst"
replace municipality_name = "Traiskirchen" if municipality_name == "Traiskirchen Pf.23"
replace municipality_name = "Tulln an der Donau" if municipality_name == "Tulln"
replace municipality_name = "Velden am Wörther See" if inlist(municipality_name, "Velden am Wörthersee", "Velden")
replace municipality_name = "Waidhofen an der Thaya" if inlist(municipality_name, "Waidhofen a.d. Thaya", "Waidhofen/Thaya")
replace municipality_name = "Waidhofen an der Ybbs" if municipality_name == "Waidhofen/Ybbs"
replace municipality_name = "Wals-Siezenheim" if municipality_name == "Wals"
replace municipality_name = "Wiener Neustadt" if inlist(municipality_name, "Wr. Neustadt", "Wr.Neustadt")
replace municipality_name = "Amaliendorf-Aalfang" if municipality_name == "Aalfang"
replace municipality_name = "Braunau am Inn" if municipality_name == "Braunau"
replace municipality_name = "Bruck an der Mur" if municipality_name == "Bruck/Mur"

replace municipality_name = "Baumgarten" if municipality_name == "Baumgarten/Tullnerf."
replace municipality_name = "Ehrenhausen an der Weinstraße" if municipality_name == "Ehrenhausen"
replace municipality_name = "Zwettl-Niederösterreich" if municipality_name == "Groß Globnitz"
replace municipality_name = "Lobmingtal" if municipality_name == "Großlobming"
replace municipality_name = "Hermagor-Pressegger See" if municipality_name == "Hermagor"
replace municipality_name = "St. Andrä-Wördern" if municipality_name == "Hintersdorf"
replace municipality_name = "Neustift-Innermanzing" if municipality_name == "Innermanzing"
replace municipality_name = "Kirchberg an der Pielach" if municipality_name == "Kirchberg/P."
replace municipality_name = "Klagenfurt am Wörthersee" if municipality_name == "Klagenfurt"
replace municipality_name = "Krems an der Donau" if municipality_name == "Krems"
replace municipality_name = "Klosterneuburg" if municipality_name == "Kritzendorf"
replace municipality_name = "Paudorf" if municipality_name == "Meidling im Tal"
replace municipality_name = "Weissenbach an der Triesting" if municipality_name == "Neuhaus/Triesting"
replace municipality_name = "Rum" if municipality_name == "Neurum"
replace municipality_name = "Waldhausen" if municipality_name == "Niedernondorf"
replace municipality_name = "Puch bei Hallein" if municipality_name == "Puch"
replace municipality_name = "Ebreichsdorf" if municipality_name == "Unterwaltersdorf"
replace municipality_name = "Mattersburg" if municipality_name == "Walbersdorf"
replace municipality_name = "Wimpassing im Schwarzatale" if municipality_name == "Wimpassing"
replace municipality_name = "Wolkersdorf im Weinviertel" if municipality_name == "Wolkersdorf"

gen any = 1

collapse (count) any (first) plz ort, by(municipality_name)

rename any homeopathy_gps
lab var homeopathy_gps "Homeopathic GPs"

keep municipality_name homeopathy_gps

save "$edited/homeopathy_docs.dta", replace
